document.getElementById('version').innerHTML = 'V' + appVersion;
var btn = document.getElementById("btn");
if (localStorage.account) {
	btn.style.display = "block";
} else {
	btn.style.display = "none";
}
//安全设置
function opensafety() {
	if (checkin()) {
		mui.openWindow({
			url: 'my/safety.html',
			id: 'safety.html',
			waiting: {
				autoShow: false
			}
		});
	}
}
//清除缓存
function clearCache() {
	//document.getElementById('version').innerText = 'V' + 'jj';
	mui.toast('此功能暂未开放~谢谢');
}
//清空购物车
function clearcar() {
	if (checkin()) {
		var btnArray = ['否', '是'];
		mui.confirm('确定要清空购物车吗？', '提示', btnArray, function(e) {
			if (e.index == 1) {
				delete localStorage.buyCar;
			}
		})
	}
}
//关于我们
function aboutus() {
	mui.openWindow({
		url: 'my/aboutUs.html',
		id: 'aboutUs.html',
		waiting: {
			autoShow: false
		}
	});
}
//版本更新

//退出登录
var exit = function() {
	var btnArray = ['否', '是'];
	mui.confirm('您确定要退出当前登录用户', '退出', btnArray, function(e) {
		if (e.index == 1) {
			localStorage.removeItem("account");
			localStorage.removeItem("phone");
			localStorage.removeItem("token");
			localStorage.removeItem("tokenExpire");
			appClose();
		} else {
			//info.innerText = 'MUI没有得到你的认可，继续加油'
		}
	})
}

function appClose() {
	reloadHtml("home.html", "personal.html", "system.html","homeMarket.html")
}

function checkin() {
	if (localStorage.account) {
		return true;
	} else {
		mui.openWindow({
			url: 'my/loginHead.html',
			id: 'loginHead.html',
			waiting: {
				autoShow: false
			}
		});
	}
}